﻿<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>学生信息查询</title>
		<script type="text/javascript">
		        function selectAll() {
		            var allCheckbox = document.getElementById("all");    /* 获取ID为 all 的复选框元素 */
		            var checkboxes = document.getElementsByName("cb");   /* 获取所有名称为 cb 的复选框元素 */
		            for (var i = 0; i < checkboxes.length; i++) {    
		                checkboxes[i].checked = allCheckbox.checked;     /* 遍历所有复选框，把checked属性设置为全选复选框的checked属性值 */
		            }
		        }
		
		        function inverseSelect() {
		            var checkboxes = document.getElementsByName("cb");    
		            for (var i = 0; i < checkboxes.length; i++) {
		                checkboxes[i].checked = !checkboxes[i].checked;    /* 遍历所有复选框，并将它们的 checked 属性取反 */
		            }
		        }
		
		        function deleteSelected() {
		            var checkboxes = document.getElementsByName("cb");
		            for (var i = checkboxes.length - 1; i >= 0; i--) {	/* 从最后一个复选框开始向前遍历，如果复选框被选中，则删除该复选框所在的行。 */
		                if (checkboxes[i].checked) {					/* 使用 closest('tr') 方法找到复选框所在的 <tr> 元素 */
		                    checkboxes[i].closest('tr').remove();		/* ，然后调用 remove() 方法将其从DOM中移除。 */
		                }
		            }
		        }
		
		       window.onload = function() {
		            document.getElementById("all").onclick = selectAll;
		            document.getElementById("inverseBox").onclick = inverseSelect;
		            document.getElementById("del").onclick = deleteSelected;
		        };
		    </script>
	</head>

	<h2>录取学生信息公示</h2>
	<body>
		<tr id="1"  style=" text-align: center"  width="700">
			<td ><input type="checkbox" id="all" >全选</td> 
			 <td ><input type="checkbox" id="inverseBox">反选</td> 
	 <td ><button id="del" type="button">删除</button></td> 
			
	  </tr>
	<table id="tab" border="2" width="800">

	<!--为了显示又表格头，使用thead和tbody分段显示 -->
		<thead>    

	  
	  <tr>
	<td>选项</td><td>考生号</td><td>姓名</td><td>性别</td><td>专业</td><td>班级代号</td><td>总成绩</td><td>操作</td>
	</tr>
	</thead>
		<tbody>
									   
			<tr>
	<td><input type="checkbox" id="c1" name="cb">1</td>
									  <td>13422802130074</td><td>刘御</td><td>女</td><td>动画</td><td>130101</td><td>486</td><td>&nbsp;</td>
	</tr>
									   
			<tr>
	<td><input type="checkbox" id="c2" name="cb">2</td>
									   <td>13422802130165</td><td>陈缺</td><td>男</td><td>动画</td><td>130101</td><td>473</td><td>&nbsp;</td>
	</tr>

									   
			<tr>
	<td><input type="checkbox" id="c3" name="cb">3</td>
									   <td>13422802170146</td><td>付蕊</td><td>男</td><td>环境设计</td><td>130102</td><td>477</td><td>&nbsp;</td>
	</tr>
									   
			<tr>
	<td><input type="checkbox" id="c4" name="cb">4</td>
	<td>13429401130207</td><td>王御</td><td>男</td><td>动画</td><td>130101</td><td>474</td><td>&nbsp;</td></tr>


									   
			<tr>
	<td><input type="checkbox" id="c5" name="cb">5</td>
	<td>13429501130319</td><td>付红</td><td>女</td><td>环境设计</td><td>130102</td><td>498</td><td>&nbsp;</td></tr>

									   
									   <tr>
	<td><input type="checkbox" id="c6" name="cb">6</td>
	<td>13429501130342</td><td>周生</td><td>女</td><td>视觉传达设计</td><td>130103</td><td>446</td><td>&nbsp;</td></tr>
									   
									   <tr>
	<td><input type="checkbox" id="c7" name="cb">7</td>
	<td>13429501130647</td><td>刘蕊</td><td>男</td><td>动画</td><td>130101</td><td>442</td><td>&nbsp;</td></tr>
									   
									   <tr>
	<td><input type="checkbox" id="c8" name="cb">8</td>
	<td>13429501170037</td><td>李茹</td><td>男</td><td>环境设计</td><td>130102</td><td>480</td><td>&nbsp;</td></tr>
									   
									   <tr>
	<td><input type="checkbox" id="c9" name="cb">9</td>
	<td>13429601130340</td><td>郑方</td><td>男</td><td>环境设计</td><td>130102</td><td>470</td><td>&nbsp;</td></tr>
									   
									   <tr>
	<td><input type="checkbox" id="c10" name="cb">10</td>
	<td>13429601170054</td><td>陈帆</td><td>女</td><td>环境设计</td><td>130102</td><td>450</td><td>&nbsp;</td></tr>
									   
									   <tr>
	<td><input type="checkbox" id="c11" name="cb">11</td>
	<td>13429601170161</td><td>马军</td><td>男</td><td>环境设计</td><td>130102</td><td>463</td><td>&nbsp;</td></tr>
									  
									   <tr>
	 <td><input type="checkbox" id="c12" name="cb">12</td>
	<td>13420281850124</td><td>蒋茹</td><td>男</td><td>环境设计</td><td>130102</td><td>473</td><td>&nbsp;</td></tr>
									   
									   <tr>
	<td><input type="checkbox" id="c13" name="cb">13</td>
	<td>13420281850175</td><td>郑御</td><td>男</td><td>计算机科学与技术</td><td>130201</td><td>463</td><td>&nbsp;</td></tr>
									   
										<tr>
	<td><input type="checkbox" id="c14" name="cb">14</td>
	<td>13420321850029</td><td>李缺</td><td>男</td><td>土木工程(建筑工程)</td><td>130301</td><td>460</td><td>&nbsp;</td></tr>
									   
										<tr>
	<td><input type="checkbox" id="c15" name="cb">15</td>
	<td>13420321850093</td><td>吴方</td><td>男</td><td>土木工程(建筑工程)</td><td>130301</td><td>461</td><td>&nbsp;</td></tr>
									   
										<tr>
	<td><input type="checkbox" id="c16" name="cb">16</td>
	<td>13420527850007</td><td>徐花</td><td>女</td><td>生物工程</td><td>130401</td><td>461</td><td>&nbsp;</td></tr>
									   
										<tr>
	<td><input type="checkbox" id="c17" name="cb">17</td>
	<td>13420528810016</td><td>马成</td><td>女</td><td>土木工程(建筑工程)</td><td>130301</td><td>487</td><td>&nbsp;</td></tr>
									   
										<tr>
	<td><input type="checkbox" id="c18" name="cb">18</td>
	<td>13420528850189</td><td>赵成</td><td>男</td><td>制药工程</td><td>130501</td><td>494</td><td>&nbsp;</td></tr>
									   
										<tr>
	<td><input type="checkbox" id="c19" name="cb">19</td>
	<td>13420528850354</td><td>钱花</td><td>男</td><td>土木工程(建筑工程)</td><td>130301</td><td>469</td><td>&nbsp;</td></tr>
									   
										<tr>
	<td><input type="checkbox" id="c20" name="cb">20</td>
	<td>13420528850377</td><td>彭茹</td><td>女</td><td>土木工程(建筑工程)</td><td>130301</td><td>476</td><td>&nbsp;</td></tr>
									  
										<tr>
	 <td><input type="checkbox" id="c21" name="cb">21</td>
	<td>13420582850144</td><td>付生</td><td>女</td><td>制药工程</td><td>130501</td><td>464</td><td>&nbsp;</td></tr>
									   
										<tr>
	<td><input type="checkbox" id="c22" name="cb">22</td>
	<td>13420583850061</td><td>彭明</td><td>女</td><td>机械设计制造及其自动化</td><td>130601</td><td>461</td><td>&nbsp;</td></tr>
									   
										<tr>
	<td><input type="checkbox" id="c23" name="cb">23</td>
	<td>13420583850079</td><td>王花</td><td>男</td><td>机械设计制造及其自动化</td><td>130601</td><td>467</td><td>&nbsp;</td></tr>
									   
										 <tr>
	<td><input type="checkbox" id="c24" name="cb">24</td>
	<td>13420601851104</td><td>钱军</td><td>女</td><td>土木工程(建筑工程)</td><td>130301</td><td>494</td><td>&nbsp;</td></tr>
									   
										 <tr>
	<td><input type="checkbox" id="c25" name="cb">25</td>
	<td>13420601851153</td><td>赵彪</td><td>女</td><td>土木工程(建筑工程)</td><td>130301</td><td>493</td><td>&nbsp;</td></tr>
									 
										 <tr>
	  <td><input type="checkbox" id="c26" name="cb">26</td>
	<td>13420624850032</td><td>孙生</td><td>男</td><td>土木工程(建筑工程)</td><td>130301</td><td>461</td><td>&nbsp;</td></tr>
									  
										 <tr>
	 <td><input type="checkbox" id="c27" name="cb">27</td>
	<td>13420701850130</td><td>孙锐</td><td>男</td><td>机械设计制造及其自动化</td><td>130601</td><td>462</td><td>&nbsp;</td></tr>
									   
										 <tr>
	<td><input type="checkbox" id="c28" name="cb">28</td>
	<td>13420802810003</td><td>郑成</td><td>女</td><td>制药工程</td><td>130501</td><td>477</td><td>&nbsp;</td></tr>
									   
										 <tr>
	<td><input type="checkbox" id="c29" name="cb">29</td>
	<td>13420881850123</td><td>王帆</td><td>男</td><td>计算机科学与技术</td><td>130201</td><td>463</td><td>&nbsp;</td></tr>


			
			</tbody>
	</table>
	</body>
	</html>